import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';

import personalRoutes from './modules/personal';
import exhibitionRoutes from './modules/exhibition';
import shoppingCartRoutes from './modules/shopping-cart';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: '登录系统',
    },
  },
  ...exhibitionRoutes,
  personalRoutes,
  ...shoppingCartRoutes,
];

const router = createRouter({
  history: createWebHistory(), //process.env.BASE_URL
  routes,
});

export default router;
